package com.lzx.iteam.engine;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Message;
import com.lzx.iteam.bean.ContactInfo;

/**
 * Created by hfx_lk on 15-1-15.
 */
public class AyncGetContactInfo extends AsyncTask<Long, Void, ContactInfo> {

    private GetContactInfo mInfo;
    private Message mCallBack;

    public AyncGetContactInfo(Context context, Message callback) {
        super();
        mInfo = new GetContactInfo(context);
        mCallBack = callback;
    }

    @Override
    protected ContactInfo doInBackground(Long... longs) {
        return mInfo.getInfo(longs[0]);
    }

    @Override
    protected void onPostExecute(ContactInfo contactInfo) {
        if(mCallBack != null){
            mCallBack.arg1 = 0;
            mCallBack.obj = contactInfo;
            mCallBack.sendToTarget();
        }
    }
}
